//
//  UIColor+player.swift
//  ZPlayer
//
//  Created by 杜哲 on 2018/11/14.
//  Copyright © 2018 zuber. All rights reserved.
//

import UIKit


//#242424
//#3A3A3A
//#4E4E4E
//#7D7D7D

extension UIColor {
  
  convenience init(red: Int, green: Int, blue: Int) {
    assert(red >= 0 && red <= 255, "Invalid red component")
    assert(green >= 0 && green <= 255, "Invalid green component")
    assert(blue >= 0 && blue <= 255, "Invalid blue component")
    
    self.init(red: CGFloat(red) / 255.0, green: CGFloat(green) / 255.0, blue: CGFloat(blue) / 255.0, alpha: 1.0)
  }
  
  convenience init(rgb: Int) {
    self.init(
      red: (rgb >> 16) & 0xFF,
      green: (rgb >> 8) & 0xFF,
      blue: rgb & 0xFF
    )
  }
  
  static let coverBackgroundColor = UIColor(rgb: 0x242424)
  static let coverTrackgroundColor = UIColor(rgb: 0x3a3a3a)
  static let coverLoadedgroundColor = UIColor(rgb: 0x4e4e4e)
  static let coverPlayedgroundColor = UIColor(rgb: 0x7d7d7d)
  static let coverTextColor = UIColor(rgb: 0xABABAB)
}

